package com.game.config;

import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;

import java.io.File;

/**
 * Created by Administrator on 2016/7/5.
 */
public abstract class XMLConfig {
	protected String path = "game-data-config\\src\\main\\resources\\config\\";
	protected static Serializer serializer = new Persister();
	protected abstract String getDic();
	protected abstract String getFileName();

	protected File getFile() {
		String dic = getDic();
		File dicFie = new File(path + dic);
		boolean exists = dicFie.exists();
		if (!exists) {
			dicFie.mkdir();
		}
		String xmlpath = path + getDic()+File.separator + getFileName() + ".xml";
		return new File(xmlpath);
	}

}
